<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>

      function shuzupaixu(arr){
       if(arr.length<=1){ return arr}
           let ban=Math.floor(arr.length/2);let left=[];
         let right=[];
          let index=arr.splice(ban,1)[0]
           for(let i=0;i<arr.length;i++){
             if(arr[i]<index){
               left.push(arr[i])
             }
             else{
               right.push(arr[i])
             }
           }
           return shuzupaixu(left).concat([index],shuzupaixu(right))
       }
     console.log(shuzupaixu([5,6,8,10,23]))
</script>

</body>
</html>